﻿<Window x:Class="Zcu.PanelComposer.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ShellView" MinHeight="768" MinWidth="1024" Height="768" Width="1024"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:cal="http://www.caliburnproject.org">
    <Window.Resources>
        <Style TargetType="{x:Type Menu}">
            <Setter Property="Background" Value="{x:Null}" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <Style x:Key="StandardMenuItemStyle" TargetType="{x:Type MenuItem}">
            <Setter Property="Height" Value="30" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Padding" Value="8,5" />
        </Style>

        <Style x:Key="ThemeMenuItemStyle" TargetType="{x:Type MenuItem}" BasedOn="{StaticResource StandardMenuItemStyle}">
            <Setter Property="Header" Value="{Binding DisplayName}"/>
            <Setter Property="cal:Message.Attach" Value="ActivateItem($this)" />
        </Style>
    </Window.Resources>
    <Grid>
        <DockPanel>
            <!-- Menu -->
            <DockPanel DockPanel.Dock="Top">
                <DockPanel.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0.0">
                        <GradientStop Color="White" Offset="0" />
                        <GradientStop Color="LightBlue" Offset="0.5" />
                        <GradientStop Color="White" Offset="1" />
                    </LinearGradientBrush>
                </DockPanel.Background>
                <WrapPanel>
                    <Menu Name="MenuItems" ItemContainerStyle="{StaticResource ThemeMenuItemStyle}" />
                    <Menu>
                        <Menu.Items>
                            <MenuItem x:Name="ActiveSolutionAction" Header="{Binding Path=SelectedSolution.DisplayName}" />
                        </Menu.Items>
                    </Menu>
                </WrapPanel>
            </DockPanel>

            <!-- Status -->
            <StatusBar DockPanel.Dock="Bottom">
                <StatusBarItem HorizontalAlignment="left" Margin="0, -3">
                    <StatusBarItem.Content>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>

                            <TextBlock Grid.Column="1" Text="Pavel Lorenz © 2013" VerticalAlignment="Center" Padding="3" />
                        </Grid>
                    </StatusBarItem.Content>
                </StatusBarItem>

                <StatusBarItem HorizontalAlignment="Right">
                    <Label x:Name="Version" Content="Version: x.xx" />
                </StatusBarItem>
            </StatusBar>

            <!-- Content -->
            <ContentControl x:Name="ActiveItem"  Margin="10" />
        </DockPanel>
        <xctk:BusyIndicator IsBusy="{Binding IsBusy}" BusyContent="{Binding BusyIndicatorText}" Cursor="Wait">
            <xctk:BusyIndicator.ProgressBarStyle>
                <Style TargetType="ProgressBar">
                    <Setter Property="Height" Value="23" />
                    <Setter Property="Width" Value="250" />
                    <Setter Property="IsIndeterminate" Value="True" />
                    <Setter Property="Margin" Value="8 0 8 8 " />
                </Style>
            </xctk:BusyIndicator.ProgressBarStyle>
            <xctk:BusyIndicator.OverlayStyle>
                <Style TargetType="Rectangle">
                    <Setter Property="Fill" Value="#22000000" />
                </Style>
            </xctk:BusyIndicator.OverlayStyle>
        </xctk:BusyIndicator>
    </Grid>
</Window>
